class ArticleApprovalsController < ApplicationController
  before_filter :authenticate
  # GET /article_approvals
  # GET /article_approvals.xml
  def index
    @article_approvals = ArticleApproval.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @article_approvals }
    end
  end

  # GET /article_approvals/1
  # GET /article_approvals/1.xml
  def show
    @article_approval = ArticleApproval.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @article_approval }
    end
  end

  # GET /article_approvals/new
  # GET /article_approvals/new.xml
  def new
    @article_approval = ArticleApproval.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @article_approval }
    end
  end

  # GET /article_approvals/1/edit
  def edit
    @article_approval = ArticleApproval.find(params[:id])
  end

  # POST /article_approvals
  # POST /article_approvals.xml
  def create
    @article_approval = ArticleApproval.new(params[:article_approval])

    respond_to do |format|
      if @article_approval.save
        format.html { redirect_to(@article_approval, :notice => 'Article approval was successfully created.') }
        format.xml  { render :xml => @article_approval, :status => :created, :location => @article_approval }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @article_approval.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /article_approvals/1
  # PUT /article_approvals/1.xml
  def update
    @article_approval = ArticleApproval.find(params[:id])

    respond_to do |format|
      if @article_approval.update_attributes(params[:article_approval])
        format.html { redirect_to(@article_approval, :notice => 'Article approval was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @article_approval.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /article_approvals/1
  # DELETE /article_approvals/1.xml
  def destroy
    @article_approval = ArticleApproval.find(params[:id])
    @article_approval.destroy

    respond_to do |format|
      format.html { redirect_to(article_approvals_url) }
      format.xml  { head :ok }
    end
  end
end
